<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

	
<html>
  <head>
   
    
    <title>品牌申请</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<style type="text/css">
.quandianping {
	padding-bottom: 5px;
	padding-top: 5px;
}
.tijiao {
	background-image: url(<%=basePath%>/resource/img/index/tijiao.jpg);
	background-repeat: no-repeat;
	background-position: right 12px;
	float: left;
	height: 28px;
	width: 75px;
	font-size: 14px;
	line-height: 28px;
	font-weight: bold;
	color: #FFF;
	text-align: center;
	padding-top: 12px;
	padding-bottom: 5px;
	padding-left: 0px;
}
.tijiao a {
	color: #FFF;
	text-decoration: none;
}
.tijiao a:hover {
	color: #036;
}
body {
	font-size: 13px;
	color: #0067ce;
	margin: 0px;
	padding: 0px;
}
</style>
   <script type="text/javascript" src="<%=basePath %>resource/js/jquery-1.4.2.js"></script>
  </head>
  
  <body>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr align="center" valign="middle">
    <td>
    
    <table width="310" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="95" align="right"><div class="quandianping">
          <label for="textfield">申请名称：</label></div></td>
        <td align="left">
          <div class="quandianping"><input id="name" type="text" maxlength="25"/><em style="color:#F00">*</em></div></td>
      </tr>
      <tr>
        <td width="95" align="right"><div class="quandianping">
          <label for="textfield">申请人：</label></div></td>
        <td align="left">
          <div class="quandianping"><input id="user" type="text" maxlength="25"/><em style="color:#F00">*</em></div></td>
      </tr>
      <tr>
        <td align="right"><div class="quandianping">
        <label for="textfield2">联系电话：</label></div></td>
        <td align="left">
          <div class="quandianping"><input id="tel" type="text" maxlength="14"/><em style="color:#F00">*</em></div></td>
      </tr>
      <tr>
        <td align="right" valign="top">&nbsp;</td>
        <td align="left">
        
        <div class="tijiao"><a href="#" onclick="add()" >提交</a></div>
        </td>
      </tr>
    </table>
    </td>
  </tr>
</table>
      
  </body>
  
  <%
  String type=request.getParameter("type");
%>
<script>
   var  basepath="<%=basePath %>";
   var type="<%=type %>";
  function add(){
              var  name= $("#name").val();
              if(""== name){
                  alert("请填写申请名称");
                   $("#name").focus();
                   return ;
              }
             
              var  tel= $("#tel").val();
              if(""== tel){
                  alert("请填写联系电话！");
                 $("#tel").focus();
                  return ;
              }
              
              var  user= $("#user").val();
              if(""== user){
                  alert("请填写申请人姓名！");
                 $("#user").focus();
                  return ;
              }
           
              $.post( basepath+"/part/saveOrUpdate.shtml?part.name="+encodeURI(encodeURI(name))+"&part.user="+encodeURI(encodeURI(user))+"&part.tel="+tel+"&part.auding=0&part.type="+type
               ,function(message){
				if(message == "1"){
					alert("申请成功");
			        window.close();
				}else if(message == "2") {
					alert("申请出错");
					return;
				}
			})
	
            
		}
</script>
  
</html>
